<?php
/*
 +----------------------------------------------------------------------
 | TEMMOKUMVC [ NO BEST, ONLY BETTER ]
 +----------------------------------------------------------------------
 | Copyright (c) 2018~2019 https://www.temmoku.cn All rights reserved.
 +----------------------------------------------------------------------
 | Author: 张宗强 Email:webmaster@temmoku.cn QQ:158726877 516669373 TEL:17895221001 微信:temmokumvc
 +---------------------------------------------------------------------- 
*/
namespace temmoku\lib;
use temmoku\db;
class integral {
	
	public function add($uid,$integral,$text){
		db::query("UPDATE `".jab."user` SET `integral` = `integral`+$integral WHERE uid=$uid");
		(new sms)->station_message_post('',$uid,'积分变动通知',$text);
		$this->Integral_log($uid,$integral,$text);
		
	}
	
	private function Integral_log($uid,$integral,$text){
		$arr=[
			'uid'=>(int)$uid,
			'integral'=>$integral,
			'content'=>$text,
			'posttime'=>NOWTIME
		];
		db::insert(jab.'integral_log')->cols($arr)->query();
	}
}
?>